#include <Ogre.h>
#include <OIS/OIS.h>
#include <btBulletDynamicsCommon.h>
#include <vector>
#include "ZombieManager.h"
#include "Human.h"
#include "BtOgrePG.h"
#include "BtOgreGP.h"
#include "BtOgreExtras.h"

using namespace Ogre;

class MyFrameListener : public Ogre::FrameListener {
private:
  Ogre::Camera* _camera;
  Ogre::OverlayManager* _overlayManager;
  Ogre::SceneManager *_sceneManager;

  OIS::InputManager* _inputManager;
  OIS::Keyboard* _keyboard;
  OIS::Mouse* _mouse;

  btBroadphaseInterface* _broadphase;
  btDefaultCollisionConfiguration* _collisionConf;
  btCollisionDispatcher* _dispatcher;
  btSequentialImpulseConstraintSolver* _solver;
  btDiscreteDynamicsWorld* _world;

  ZombieManager* _pZombieManager;

  btCylinderShape* _pHumanShape;
  Human* _pHuman;

  btCollisionShape* _groundShape;
  btRigidBody* _groundRigidBody;
  void CreateInitialWorld();

  // BoxShapes para el escenario
  btBvhTriangleMeshShape* _pStageShape;
  btScaledBvhTriangleMeshShape* _pScaledStageShape;
  btRigidBody* _pStageBody;

  // btOgre
  BtOgre::DebugDrawer* _pDebugDrawer;

public:
  MyFrameListener(Ogre::RenderWindow* win, Ogre::Camera* cam,
		  Ogre::OverlayManager* om, Ogre::SceneManager* sm);
  ~MyFrameListener();
  bool frameStarted(const Ogre::FrameEvent& evt);
  bool frameEnded(const Ogre::FrameEvent& evt);

  void createStage();
};
